import { axios } from '@/utils/request'
const api = {
  driverInfo: '/shifts/driverinfo',
  data: '/shifts/data'
}

export function getDriverInfoList (parameter) {
  return axios({
    url: api.driverInfo + '/list',
    method: 'get',
    params: parameter
  })
}

export function saveDriverInfo (parameter) {
  return axios({
    url: api.driverInfo + (parameter.driverid > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delDriverInfo (parameter) {
  return axios({
    url: api.driverInfo + '/remove',
    method: 'post',
    params: parameter
  })
}

export function getDrivermsg (parameter) {
  return axios({
    url: api.driverInfo + '/get',
    method: 'get',
    params: parameter
  })
}
export function getDriverimg (parameter) {
  return axios({
    url: api.img + '/upload',
    method: 'post',
    params: parameter
  })
}
// 禁用启用方法
export function EnableDisabled (parameter) {
  return axios({
    url: api.driverInfo + '/EnableDisabled',
    method: 'post',
    params: parameter
  })
}
// 驳回方法
export function identityAuthenticationBH (parameter) {
  return axios({
    url: api.driverInfo + '/identityAuthenticationBH',
    method: 'post',
    params: parameter
  })
}
// 认证
export function identityAuthentication (parameter) {
  return axios({
    url: api.driverInfo + '/identityAuthentication',
    method: 'post',
    params: parameter
  })
}
// 数据看板（主页）
export function getWatch () {
  return axios({
    url: api.data + '/watch',
    method: 'get'
  })
}

export const driverInfoExport = api.driverInfo + '/export'
